import java.util.*;

public class SentinelValue {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        System.out.print("Ievadi kādu naturālu skaitli"
                + "\n(nulli - lai programma pārtrauc izpildi) : ");
        int data = scanner.nextInt();
        
        int sum = 0;
        while(data != 0){
            sum += data;
            System.out.print("Ievadi kādu naturālu skaitli"
                + "\n(nulli - lai programma pārtrauc izpildi) : ");
            data = scanner.nextInt();
        }
        System.out.println("Summa ir vienāda ar " + sum);
    }
}
